package com.mallcloud.mall.mall.api.entity.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import java.util.Optional;

@ApiModel(value = "ProCouponBatchWriteOff", description = "券批量核销对象")
@Data
@ToString
public class ProCouponBatchWriteOff {

	@ApiModelProperty(value = "会员卡号")
	private String cardNo;
	@ApiModelProperty(value = "券号")
	private String couponNo;
	@ApiModelProperty(value = "手机号")
	private String phone;

	@ApiModelProperty(value = "返回id 0-核销成功，1-核销失败", hidden = true)
	private Integer messageId;
	@ApiModelProperty(value = "返回信息", hidden = true)
	private String message;
	@ApiModelProperty(value = "批量核销单号", hidden = true)
	private String batchWriteOffNumber;

	public boolean isSuccess() {
		return Optional.ofNullable(this.messageId).map(x -> x.equals(0)).orElse(false);
	}
}
